<?php

namespace App\Services;

/**
 * The SearchIndexServiceInterface defines the contract for a search index service.
 */
interface SearchIndexServiceInterface
{
    /**
     * Performs a search in the specified index.
     *
     * @param string $index The name of the index to search.
     * @param array $body The search query body.
     */
    public function search(string $index, array $body);

    /**
     * Deletes the specified index.
     *
     * @param string $index The name of the index to delete.
     */
    public function deleteIndex(string $index);

    /**
     * Creates a new index with the specified settings and mappings.
     *
     * @param string $index The name of the index to create.
     * @param string $id The ID of the document to index.
     * @param array $body The document body.
     */
    public function createIndex(string $index, string $id, array $body);

    /**
     * Checks if the specified index exists.
     *
     * @param string $index The name of the index to check.
     * @return bool True if the index exists, false otherwise.
     */
    public function indexExists(string $index): bool;
}
